<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$return['allgames']=$this->allgames;
	$allgames=$this->setting['allgames'];
	foreach($return['allgames'] as $k=>&$p){
        $p['icon']=tomedia($p['icon']);
		$install = $this->plugin_exists($p['name']);
		if(!$install){
			unset($return['allgames'][$k]);
		}
		if($allgames  && strpos($allgames, $p['name']) === false){
			unset($return['allgames'][$k]);
		}
	}
	$return['alltools']=$this->alltools;
	$alltools=$this->setting['alltools'];
	foreach($return['alltools'] as $k=>$v){
		$install = $this->plugin_exists($v['name']);
		if(!$install){
			unset($return['alltools'][$k]);
		}
		if($alltools  && strpos($alltools, $v['name']) === false){
			unset($return['alltools'][$k]);
		}
	}
	$return['setting']=$this->setting;
	cfc('core')->checklogin('jy_quanhuo/addgame/');
	if($this->setting['zc_merch']){
		$merchid=model('jy_merch/model')->checkmerch();
	}else{
		$merchid=model('jy_merch/model')->checkadd_merch();
	}
	$check_tihuo=model('jy_merch/model')->check_tihuo($merchid);
	if(!$check_tihuo){
		$_SESSION['forward_url']=$_AR['access_json'];
		exi('请先设置提货点！','error','jy_merch/manage.tihuo/');
	}
	$return['item']=pdo_get('jy_merch_user',array('id'=>$merchid,'uniacid'=>$_SESSION['uniacid']));
	$return['tips']=model('jy_merch/model')->checkviptime($return['item']);	
	exi($return);
}